﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ET.DBCommon.Model
{
    /// <summary>
    /// 事件查看器
    /// </summary>
    public class EventRecordModel : NotifyPropertyChanged
    {
        /// <summary>
        /// 所属竞赛
        /// </summary>
        public int ExamResultsID { get; set; }
        /// <summary>
        /// 所属场景
        /// </summary>
        private int m_QuestionID;
        public int QuestionID
        {
            get
            {
                return this.m_QuestionID;
            }
            set
            {
                this.m_QuestionID = value;
                this.OnPropertyChanged("QuestionID");
            }
        }
        /// <summary>
        /// 事件类型
        /// </summary>
        private LogType m_EventLogType;
        public LogType EventLogType
        {
            get
            {
                return this.m_EventLogType;
            }
            set
            {
                this.m_EventLogType = value;
                this.OnPropertyChanged("EventLogType");
            }
        }
        /// <summary>
        /// 内容
        /// </summary>
        private string m_Message;
        public string Message
        {
            get
            {
                return this.m_Message;
            }
            set
            {
                this.m_Message = value;
                this.OnPropertyChanged("Message");
            }
        }
        /// <summary>
        /// 发生时间
        /// </summary>
        private DateTime m_CreateTime;
        public DateTime CreateTime
        {
            get
            {
                return this.m_CreateTime;
            }
            set
            {
                this.m_CreateTime = value;
                this.OnPropertyChanged("CreateTime");
            }
        }

        public EventRecordModel Clone()
        {
            return new EventRecordModel()
            {
                CreateTime = this.CreateTime,
                EventLogType = this.EventLogType,
                ExamResultsID = this.ExamResultsID,
                Message = this.Message,
                QuestionID = this.QuestionID
            };
        }
    }

    public enum LogType
    {
        /// <summary>
        /// 错误
        /// </summary>
        error = 1,
        /// <summary>
        /// 过程消息
        /// </summary>
        info = 2,
        /// <summary>
        /// 当前状态
        /// </summary>
        CurrentTask = 3,
        /// <summary>
        /// 日志采集
        /// </summary>
        log = 4
    }
}
